home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.19960209-19960425 / 000189_news@columbia.edu _Sun Mar 10 18:47:21 1996.msg < prev    next >
Internet Message Format  |  2020-01-01  |  2KB

  1. Return-Path: news@columbia.edu
  2. Received: from apakabar.cc.columbia.edu (apakabar.cc.columbia.edu [128.59.35.159]) by watsun.cc.columbia.edu (8.7.3/8.7.3) with ESMTP id SAA00864 for <kermit.misc@watsun>; Sun, 10 Mar 1996 18:47:21 -0500 (EST)
  3. Received: (from news@localhost) by apakabar.cc.columbia.edu (8.7.3/8.7.3) id SAA19131 for kermit.misc@watsun; Sun, 10 Mar 1996 18:47:19 -0500 (EST)
  4. Path: news.columbia.edu!watsun.cc.columbia.edu!fdc
  5. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  6. Newsgroups: comp.protocols.kermit.misc
  7. Subject: Re: How to get string with '\' into take script?
  8. Date: 10 Mar 1996 23:47:14 GMT
  9. Organization: Columbia University
  10. Lines: 46
  11. Message-ID: <4hvpm2$ilp@apakabar.cc.columbia.edu>
  12. References: <31418faf.52414e414848@ranahh.hanse.de>
  13. NNTP-Posting-Host: watsun.cc.columbia.edu
  14.  
  15. In article <31418faf.52414e414848@ranahh.hanse.de>,
  16. Volkmar Grote <vgrote@ranahh.hanse.de> wrote:
  17. : I have built a little mail interface to a paging service and 
  18. : I use Kermit (5A/190 on BSD/OS 2.0.1) to make the call to the mailbox.
  19. : The paging service uses 7 bit ASCII with NRCS, so I end up
  20. : with an unpredictable number of backslashes for the capital
  21. : "O Umlaut".
  22. : These characters arrive in their 8 bit form on my Unix box
  23. : in the "Subject:" line, I build the string with the pager number
  24. : and the checksum and feed it to a take script. I am already
  25. : successful in handling embedded '\'s, like in "R\DEL", (with
  26. : 16 successive '\'s in an sed command) but characters at the
  27. : beginning or the end of a word and groups of multiple backslashes
  28. : don't come through. :-(
  29. : Can I prevent Kermit from interpreting the '\'s? Or can I
  30. : substitute them on the command line so they come out correctly
  31. : in the output commands?
  32. I think the answer is pretty simple, if not obvious, but I am not
  33. certain because I haven't seen your script.
  34.  
  35. Now suppose you have a variable \%a that contains a string which
  36. has backslashes in it.  Suppose this string looks like this:
  37.  
  38.   a\7b\%c\\d
  39.  
  40. Further suppose that \%c is defined to be a string "xyz".  Then:
  41.  
  42.   echo \%a
  43.  
  44. produces:
  45.  
  46.   a<BEEP!>xyz\d
  47.  
  48. because, unless you say otherwise, variables are evaluated recursively.
  49.  
  50. Now suppose you want to keep the backslashes (U-umlauts) intact.  We
  51. have a function for that, \fcontents():
  52.  
  53.   echo \fcontents(\%a)
  54.   a\7b\%c\\d
  55.  
  56. Does this help?
  57.  
  58. - Frank